/*
* @Author: Choisaaaa
* @Date: 2018/5/8  17:21
* 后台管理用户模块
*/

import Mutil from "util/mm.jsx";
const _mm = new Mutil();

class User{
    //1.获取用户列表
    getUserList(listParam){
        console.log(listParam);
        let url = "",
            data = {};
        if(listParam.listType === "list"){//正常分页显示
            url = '/manage/user/list.do';
            data.pageNum = listParam.pageNum;
        }else if(listParam.listType === "search"){//按搜索条件分页显示
            url = '/manage/user/search_users.do';
            data.pageNum = listParam.pageNum;
            data[listParam.searchType] = listParam.keyword;
        }
        return _mm.request({
            type    : 'post',
            url     : url,
            data    : data
        });
    }
    //2.更新用户状态
    updateStatus(userInfo){
        return _mm.request({
            type    : 'post',
            url     : '/manage/user/update_user_status.do',
            data    : userInfo
        });
    }

}
export default User;